<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<?xml version="1.0" encoding="UTF-8"?>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page session="true"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Файлы</title>
</head>
<body>
	<div>
		<form method="POST" enctype="multipart/form-data"
			action="${contextPath}/upload?${_csrf.parameterName}=${_csrf.token}">
			<input type="hidden" name="file_name" value="" /> Файл: <input
				type="file" name="file">
			<p />
			<input type="submit" value="Загрузить">
		</form>
	</div>
	<div>
		<table>
			<c:forEach items="${files}" var="file">
				<tr>
					<td><a href="<c:url value="/files/${file.id}"/>"><c:out
								value="${file.name}"></c:out></a> &nbsp;&nbsp; <a
						href="<c:url value="/files/delete/${file.id}"/>">Удалить</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</body>
</html>